home *** CD-ROM | disk | FTP | other *** search
- Path: news.azstarnet.com!usenet
- From: "S. Brenner" <brenner@azstarnet.com>
- Newsgroups: comp.lang.c++
- Subject: Help with Code
- Date: Thu, 22 Feb 1996 13:49:31 +0000
- Organization: Arizona Daily Star - AZSTARNET
- Message-ID: <312C746B.50DA@azstarnet.com>
- References: <4gi3l1$kou@news.voicenet.com>
- NNTP-Posting-Host: usr3ip22.azstarnet.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Macintosh; I; PPC)
-
- This code is from "Tech yourself C++ programming in 21
- Days"
- But I cannot get it to compile. I am using Code warrrior gold
- and ansi C++.
-
- This is the error message I keep getting:
-
- Error : ambiguous access to overloaded function
- 3.7.c line 9 cin >> DayOff;
-
-
- And this is the Code:
-
- #include <iostream>
- void main()
- {
- enum Days { Sunday, Monday, Tuesday, Wednesday,
- Thursday, Friday, Saturday };
-
- Days DayOff;
-
- cout << "What day would you like off (0-6)? ";
- cin >> DayOff;
-
- if (DayOff == Sunday || DayOff == Saturday)
- cout << "\nYou're already off on weekends!\n";
- else
- cout << "\nOkay, I'll put in the vacation day.\n";
- }
-